<?php
declare(strict_types=1);

namespace App\Controller;

use Hyperf\HttpServer\Annotation\AutoController;
use Hyperf\RateLimit\Annotation\RateLimit;

/**
 * Class RateLimitController
 * @package App\Controller
 * @AutoController()
 */
class  RateController
{
    /**
     * 限流通过=异常去捕获
     * @RateLimit(create=1,consume=1,capacity=3)
     */
    public function test()
    {
        return ['qps=1', 'up=3'];
    }

    /**
     * @RateLimit(create=2,consume=2,capacity=4)
     */
    public function test2()
    {
        return ['qps=2', 'up=2'];
    }
}